#ifndef WAITQUEUE_H
#define WAITQUEUE_H

#include <stdbool.h>

#include "user_threads.h"

struct tq * tq_init();
void tq_fini(struct tq *);

int tq_add(struct tq *, thread_id);
/* tq_add: Returns 0 on success */

int tq_peek(struct tq *, thread_id *);

int tq_remove(struct tq *, thread_id * out_id);
/* tq_remove():
	Removes the head thread and put it in *out_id (if out_id is not NULL).
	Returns 0 on success.
*/

int tq_remove_thread(struct tq *, thread_id thread_to_remove);
/* tq_remove_thread():
	Removes the thread 'thread_to_remove'.
	Returns 0 on success.
*/


bool tq_is_empty(struct tq *);

#endif /* WAITQUEUE_H */
